This thingy groups a bunch of pictures together and takes them apart using PicComments and a QuickDraw bottleneck procedure. It's an example of how to store and retrieve custom PicComments, among other things.
Here's how it works:
All pictures are kept in a global structure for easy access. Note that I use the same bounds rectangle for all the pictures, but this isn't necessary. You should make sure that the enclosing picture is wide enough to hold all the others though, or else you'll get clipping when they're displayed. The global structure contains:
• The no. of pictures currently stored.
• The PicHandles for each of those pictures.
• The last rectangle each picture was drawn
in. (For erase and redraw procedures.)
First, the app creates some individual pictures of various objects. Then it repeatedly groups and ungroups them until the user chooses Quit from the File menu.
For demonstration purposes, the app moves the pictures around as it alternates between grouped and ungrouped stages. This just shows the user that we really have separate or consolidated pictures, as the case may be.
Good stuff to look for:
• Example of custom PicComment usage with unique
identifiers as in Tech Note #181.
{-> GroupiesPicProc, AssembleGroupies <-}
• Example of a custom QuickDraw bottleneck procedure
which works in both GrafPorts and CGrafPorts.
{-> DisassembleGroupies <-}
• Example of finding the deepest device and placing
a window on it.
{-> ShowTheGroupies <-}
Lastly, my apologies for all the bad "groupie humor."
{Any similarities to, or resemblance of, actual DTS Groupies living or dead is purely coincidental